<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@2.7.14/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <mycom>
            <!-- 为指定插槽分发样式 -->
            <h4 slot="title">这是标题，通过插槽分发</h4>
            <p slot="tail">这是版权，尾部信息，通过插槽分发</p>
            <p slot="content">这是内容，同样通过插槽分发</p>
        </mycom>

    </div>

    <template id="mytemp">
        <div>
            <div><slot name="title"></slot></div>
            <div><slot name="content"></slot></div>
            <div><slot name="tail"></slot></div>
        </div>
    </template>

    <script>
        Vue.component(
            "mycom", {
                template: "#mytemp",
            }
        )
        new Vue({
            el: "#app"
        })
    </script>
</body>
</html>